<link href="/res/css/common/baseAzt.css" rel="stylesheet" type="text/css" />
<link href="/res/css/common/backheadfoot.css" rel="stylesheet" type="text/css" />
<link href="/res/third/layer/skin/default/layer.css" rel="stylesheet">
<style>
.textoverflowNav{
	position: relative;
	left: 0;
	top: 0;
	overflow: hidden;
	width: 100px;
}
.textoverflowNav em {
	display:block;
	width:75px;
	margin: 0px 0px 0px 3px;
	white-space: nowrap;
	overflow: hidden;
	float: left;
	-o-text-overflow: ellipsis; 
	text-overflow: ellipsis; 
	font-style: normal;  
} 

@media all and (min-width: 0px){ 
    .textoverflowNav:after{ 
        content:""; 
    }  
}

/*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/
::-webkit-scrollbar
{
    width: 10px;
}

/*定义滚动条轨道 内阴影+圆角*/
::-webkit-scrollbar-track
{
    border-radius: 10px;
    background-color: white;
}

/*定义滑块 内阴影+圆角*/
::-webkit-scrollbar-thumb
{
    border-radius: 10px;
    background-color: #e3e3e3;
}
</style>
[@businessmenu_list showType=2 menucode=menucode]
<div class="backhead">
         	 <a href="/" class="logo" style="padding-left: 15px;width: 175px;"><img src="/res/images/logoAzt/logoIndex_03.png" alt="网上采购平台"></a>
         	 [#if parentmenu??]
             <ul class="nav">
		     [#list parentmenu as par]
		     [#if par.code?? && par.code='myMessage']
		     [#else]
             	 <li><a href="${par.uri!}" class="[#if par.code?? && parmenucode?? && parmenucode.code??][#if par.code==parmenucode.code]backhead_active[#elseif parmenucode.showType==1 && par.id==2]backhead_active[/#if][/#if]"><span>${par.name!}</span></a></li>
             [/#if]
             [/#list]
             </ul>
		     [/#if]
		     [#if currentUser??]
             <div class="user">
             	<a href="#" class="des">
                	<span class="pic"><img style="height: 32px;" src="[#if currentUser.logo?? && currentUser.logo?length gt 0]${currentUser.logo!}[#else]/res/images/common/userLogo_05.png[/#if]" alt=""></span>
				<div class="textoverflowNav">
					<em class="userName" onclick="javascript:location.href='/safecenter/personalData'">[#if  currentUser.realName??][#assign name='${currentUser.realName!}' /]
				[#elseif currentUser.email??][#assign name='${currentUser.email!}' /]
				[#elseif currentUser.mobile??][#assign name='${currentUser.mobile!}' /][/#if]
				[#if name??]${name!}[/#if]</em>
				</div> 
                    <i></i>
                </a>
                <dl>
                	<dd style="line-height: 1;"><a target="_blank" href="/sysfoot/helpCenter" class="icon-help">帮助中心</a></dd>
                    <dd><a href="javascript:void(0);" onclick="logout();" class="icon-out">退出</a></dd>
                </dl>
             </div>
             [/#if]
             [#if msgList?? && msgList?size>0] 
             	  <div class="myMesage">
	             	<a>
	             		<img style="margin-top: 12px;" alt="" src="/res/images/common/head/icon_06.png"/>
	             	</a>
	             	<ul class="detailMesage">
	             		<li class="arrow">
	             			<!-- <img src="/res/images/arrow/icon_11.png"/> -->
	             		</li>
	             		[#list msgList as msg]
	             		<li>
	             			<a [#if msg_index==0]style="border:none;"[/#if] href="/msg/msglist?code=${msg.code!}">${msg.name!}<span>${msg.num!}</span></a>
	             		</li>
	             		[/#list]
	             	</ul>
	             </div>
             [#else]  
             	<img style="margin-top: 12px;" alt="" src="/res/images/common/head/icon_07.png"/>
             [/#if] 
             <div class="company">
            [#if User?? && User.company?? && User.company.auditState==3][#if topCompany??  && User.company.parentId??]${topCompany.companyName!}-[/#if]${User.company.companyName!}[/#if]
            [#if User?? && User.roles?? && currentRole??]
			[#list User.roles as role]
			[#if role.ifAdmin==1 && role.ifDefault==1]
			[#if role.roleType==1  && currentRole.roleType==2]
			<a data-type="switchLink" style="margin-top: 10px;" href="javascript:void(0);" onclick="switchRole()" >
				切换至采购商
			</a>
			[/#if]
			[#if role.roleType==2 && currentRole.roleType==1]
			<a data-type="switchLink" style="margin-top: 10px;"  href="javascript:void(0);" onclick="switchRole()" >
				切换至供应商
			</a>
			[/#if]
			[/#if]
			[/#list]
			[/#if]
         </div>
         </div>
[/@businessmenu_list]
<script src="/res/js/common/jquery.1.12.4.min.js" type="text/javascript"></script>
<script src="/res/js/common/common.js"></script>
<script type="text/javascript">
[#if currentRole?? &&  currentRole.roleType==2] 
$(".warp").addClass("warp-supplier"); 
[#else]  
[/#if]
$(function(){
	var sz=$(".backhead .myMesage ul.detailMesage").children("li").size();
	var ht=sz*48-38;
	$(".user").hover(function(e){   
		$(this).children("dl").animate({height:"90px"},300);  
	},function(){ 
		$(this).children("dl").stop(); 
		$(this).children("dl").height(0); 
	});
	
	$(".backhead .myMesage").hover(function(){ 
		$(this).children("ul").animate({height:ht-2},300);
	},
	function(){
		$(this).children("ul").stop();
		$(this).children("ul").height(0);
	});
})
function logout() {
	$.post('/user/logout', function() {
		location.replace('/');
	});
}

function switchRole() {
    $.post('/user/switch', function(data){
    if(data.success){
    	location.href="/user/userCenter";
    }else{
    	alert(data.msg);
    }
    },"json");
}
</script>